<?php
    if (!defined('EXPONENT')) exit('');
    if (exponent_users_isAdmin() ||  exponent_permissions_check(array("administrate"),$loc))
    {
        $template=new template("mailsystemmodule","manage_main",$loc); 
        $group=$db->selectDropdown('mailsystem_template','group','1',"{$db->prefix}mailsystem_template.group");
        $template->assign('groups',$group);
        $type=$db->selectDropdown('mailsystem_log','type','1',"type");
        $template->assign('log_types',$type);
        //For template
        $temp=$db->selectObjects('mailsystem_template');
        $temps=null;
        foreach($temp as $v)
        {
           $temps[$v->id]=$v; 
        }
        //Template list
        $template->assign('temps',$temp);
        $template->assign('jtemp',json_encode($temps));
        $template->output();       
    }
    else
        echo exponent_http_error(403);
?>
